/**
 * 添加机型评价
 */
//  获取时间戳
var newTime = timeAll();
$('#btn_submit').click(function () {
    var ticking = $('#addCon').val();
    var reg=/^((0\d{2,3}-\d{7,8})|(1[35784]\d{9}))$/;
    var phoneNum = $('#phoneID').val();

    var timestamp ='phoneNum:'+phoneNum+'BM'+'suggestionContent:'+ticking+'BM'+'timeStamp:' + newTime + 'BM';
    console.log(timestamp)
    var signs = md5(timestamp);
    signs = signs.toUpperCase();

    if(ticking.length == 0){
        alert('请你提出您的你的宝贵意见')
    } else if(phoneNum == undefined){
        alert('手机号码不能为空');
    } else if (!reg.test(phoneNum)){
        alert("您输入的手机号码不合法")
    } else {
        $.ajax({
            type: 'get',
            url: webUrl + "upstreamquotation/addProductModelFeedback",
            data: {
                "phoneNum": phoneNum,
                "sign": signs,
                "suggestionContent": ticking, //  文本输入内容是否需要转意
                "timeStamp": newTime,

            },
            dataType: 'JSON',
            async: false,
            success: function (data) {

                if(data.status == '200'){
                    javascript:history.back(-1);

                }else if(data.status == "300"){
                    document.location.href = '../html/login.html'
                }else if(data.status == '500'){
                    alert(data.msg);
                }
            }
        })
    }
});